package com.zetor.ms.repository.mapper.mybatisplus;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zetor.ms.repository.entity.seata.DemoStockEntity;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


/**
 * mybatis demo
 * @author zlc
 * @date 6.16
 */
public interface DemoStockMapper extends BaseMapper<DemoStockEntity> {
    @Update("update demo_stock set count = count + 10 where id = #{id}")
    void updateStock(Long id);

    @Select("select count from demo_stock where id = #{id} for update")
    Integer selectStock(Long id);
}
